<gm:page title="Check Register" authenticate="true">

  <!--
    This form allows you to enter checks into the register
    @author: Chad Tucker
  -->

  <div class="gm-app-header">
    <h1>Form Input</h1>
    Enter data into the form below. See the data appear when you save.
  </div>

  <table>
    <tr>
      <td style="padding-right:15px" valign="top">
        <gm:item data="${app}/foo" create="true" template="myItemTemplate" />
      </td>
      <td style="width:350px" valign="top">
        <gm:list data="${app}/foo" template="myListTemplate"/>
      </td>
    </tr>
   </table>

   <gm:template id="myItemTemplate">
     <table>
       <tr>
         <td>Check Number:</td>
         <td><gm:text ref="atom:title"/></td>
       </tr>
       <tr>
         <td>Date:</td>
         <td><gm:date ref="gd:when/@startTime"/></td>
       </tr>
       <tr>
         <td>Pay To:</td>
         <td><gm:text ref="atom:payto"/></td>
       </tr>
       <tr>
         <td colspan="2" style="padding-top:10px">
           <gm:editButtons text="true"/>
         </td>
       </tr>
     </table>
   </gm:template>

   <gm:template id="myListTemplate">
     <table class="blue-theme" style="width:100%">
       <thead>
         <tr>
           <th>Check Number</th>
           <th>Date</th>
           <th>Pay To</th>
         </tr>
       </thead>
       <tr repeat="true">
         <td style="width:50%"><gm:text ref="atom:title"/></td>
         <td style="width:50%"><gm:date ref="gd:when/@startTime"/></td>
         <td style="width:50%"><gm:text ref="atom:payto"/></td>
       </tr>
     </table>
   </gm:template>

</gm:page>
